package org.ccay.security.config;

import java.util.Set;

import org.ccay.core.ioc.Ccay;

/**
 * 安全控制配置
 * @author chaowangbang
 *
 */
public class SecurityConfig {

	private static SecurityConfigBean securityConfigBean;
	/**
	 * 根据维度名称获取维度定义
	 * @param dimensionName
	 * @return
	 */
	public static DimensionDefineConfig findDimensionDefineConfig(String dimensionName){
		return SecurityConfig.findSecurityConfigBean().findDimensionDefineConfig(dimensionName);
	}
	
	public static Set<CurrentDimensionConfig> getCurrentDimensionConfigs() {
		return SecurityConfig.findSecurityConfigBean().getCurrentDimensionConfigs();
	}

	public static Set<DimensionDefineConfig> getDimensionDefineConfigs() {
		return SecurityConfig.findSecurityConfigBean().getDimensionDefineConfigs();
	}
	
	private static SecurityConfigBean findSecurityConfigBean(){
		if(securityConfigBean == null){
			securityConfigBean = Ccay.getContext().getBean("securityConfigBean", SecurityConfigBean.class);
		}
		return securityConfigBean;
	}
}
